import instance from '@/utils/request.js'



export const userLogin = (data) => {
  return instance({
    url: '/user',
    method: 'post',
    data,
  })
};

export const getUserInfo = () => {
  return instance({
    url: '/user',
    method: 'get',
  })
}

export const getUserList = (params) => {
  return instance({
    url: '/user/list',
    method: 'get',
    params,
  })
}

export const userLogout = (id) => {
  return instance({
    url: `/user/${id}`,
    method: 'delete',
  })
}

export const getUserStatistics = () => {
  return instance({
    url: '/user/getCountData',
    method: 'get',
  })

}


export const userUpdate = (data) => {
  return instance({
    url: '/user',
    method: 'put',
    data,
  })
};

export const userUpdatePassword = (data) => {
  return instance({
    url: '/user/updatePwd',
    method: 'put',
    data
  })
};
